/*           Copyright(c) 2007-2008 Dave Sexton            *
 *                   XmlTreeView Control                   *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.XPath;
using System.ComponentModel;

namespace DaveSexton.Controls
{
	/// <summary>
	/// Provides event arguments for the <see cref="XmlTreeView"/> control.
	/// </summary>
	[Serializable]
	public class XmlTreeNodeCreatingEventArgs : CancelEventArgs
	{
		#region Public Properties
		public XmlTreeNode NewNode
		{
			get
			{
				return node;
			}
			set
			{
				node = value;
			}
		}

		public IXPathNavigable Element
		{
			get
			{
				return element;
			}
		}
		#endregion

		#region Private / Protected
		private XmlTreeNode node;
		private readonly IXPathNavigable element;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="XmlTreeNodeCreatingEventArgs" /> class.
		/// </summary>
		public XmlTreeNodeCreatingEventArgs(IXPathNavigable element)
		{
			if (element == null)
				throw new ArgumentNullException("element");

			this.element = element;
		}
		#endregion
	}
}
